package sskj.regulatory.data.network

import sskj.regulatory.data.response.session.TokenResponse
import io.reactivex.Flowable
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query
import sskj.regulatory.data.request.JwtAuthenticationRequest
import sskj.regulatory.data.response.Response
import sskj.regulatory.data.response.eng.EngResponse
import sskj.regulatory.domain.entity.user.UserEntity

interface AuthApiService {

    //认证
    @POST("auth")
    fun getToken(@Body authenticationRequest: JwtAuthenticationRequest): Flowable<TokenResponse>


    //发送短信
    @GET("sys/message/vcode/send")
    fun sendVCode(@Query("phone") phone: String,
                  @Query("vcode") vcode: String,
                  @Query("signName") signName: String,
                  @Query("templateCode") templateCode: String,
                  @Query("templateParam") templateParam: String,
                  @Query("outId") outId: String): Flowable<Response>

    //注册用户
    @POST("user/register")
    fun register(@Body userEntity: UserEntity): Flowable<Response>

    //修改密码
    @POST("user/password/update")
    fun updatePwd(@Body userEntity: UserEntity): Flowable<Response>

    //是否注册
    @GET("user/isregister")
    fun isRegister(@Query("username") username: String): Flowable<Response>


    //认证
    @POST("auth/xmb")
    fun xmbAuth(@Body authenticationRequest: JwtAuthenticationRequest): Flowable<EngResponse>
}